package com.mzm.api;

import java.io.Serializable;
import java.util.List;

public class RecommendationDto implements Serializable {

	private static final long serialVersionUID = 1L;

	private Integer id;

	private String recommenderName;

	private ProductInfoDto productInfo;

	private MediaInfoDto mediaInfo;

	private Integer sheetNumber;

	private Integer grade;

	private Integer gradeRange;

	private String content;

	private String remarks;

	private Integer price;

	private String currencyCode;

	private List<String> keywords;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getRecommenderName() {
		return recommenderName;
	}

	public void setRecommenderName(String recommenderName) {
		this.recommenderName = recommenderName;
	}

	public ProductInfoDto getProductInfo() {
		return productInfo;
	}

	public void setProductInfo(ProductInfoDto productInfo) {
		this.productInfo = productInfo;
	}

	public MediaInfoDto getMediaInfo() {
		return mediaInfo;
	}

	public void setMediaInfo(MediaInfoDto mediaInfo) {
		this.mediaInfo = mediaInfo;
	}

	public Integer getSheetNumber() {
		return sheetNumber;
	}

	public void setSheetNumber(Integer sheetNumber) {
		this.sheetNumber = sheetNumber;
	}

	public Integer getGrade() {
		return grade;
	}

	public void setGrade(Integer grade) {
		this.grade = grade;
	}

	public Integer getGradeRange() {
		return gradeRange;
	}

	public void setGradeRange(Integer gradeRange) {
		this.gradeRange = gradeRange;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public Integer getPrice() {
		return price;
	}

	public void setPrice(Integer price) {
		this.price = price;
	}

	public String getCurrencyCode() {
		return currencyCode;
	}

	public void setCurrencyCode(String currencyCode) {
		this.currencyCode = currencyCode;
	}

	public List<String> getKeywords() {
		return keywords;
	}

	public void setKeywords(List<String> keywords) {
		this.keywords = keywords;
	}

	/**
	 * Checks if data is equal regardless of the id.
	 * 
	 * @param d1
	 * @param d2
	 * @return
	 */
	public boolean equalData(RecommendationDto d2) {
		if (d2 == null) {
			return false;
		}
		return getContent().equals(d2.getContent())
				|| getCurrencyCode().equals(d2.getCurrencyCode())
				|| getGrade().equals(d2.getGrade()) || getGradeRange().equals(d2.getGradeRange())
				|| getKeywords().equals(d2.getKeywords()) || getPrice().equals(d2.getPrice())
				|| getRecommenderName().equals(d2.getRecommenderName());
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((content == null) ? 0 : content.hashCode());
		result = prime * result + ((currencyCode == null) ? 0 : currencyCode.hashCode());
		result = prime * result + ((grade == null) ? 0 : grade.hashCode());
		result = prime * result + ((gradeRange == null) ? 0 : gradeRange.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((keywords == null) ? 0 : keywords.hashCode());
		result = prime * result + ((price == null) ? 0 : price.hashCode());
		result = prime * result + ((recommenderName == null) ? 0 : recommenderName.hashCode());
		result = prime * result + ((remarks == null) ? 0 : remarks.hashCode());
		result = prime * result + ((sheetNumber == null) ? 0 : sheetNumber.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RecommendationDto other = (RecommendationDto) obj;
		if (content == null) {
			if (other.content != null)
				return false;
		} else if (!content.equals(other.content))
			return false;
		if (currencyCode == null) {
			if (other.currencyCode != null)
				return false;
		} else if (!currencyCode.equals(other.currencyCode))
			return false;
		if (grade == null) {
			if (other.grade != null)
				return false;
		} else if (!grade.equals(other.grade))
			return false;
		if (gradeRange == null) {
			if (other.gradeRange != null)
				return false;
		} else if (!gradeRange.equals(other.gradeRange))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (keywords == null) {
			if (other.keywords != null)
				return false;
		} else if (!keywords.equals(other.keywords))
			return false;
		if (price == null) {
			if (other.price != null)
				return false;
		} else if (!price.equals(other.price))
			return false;
		if (recommenderName == null) {
			if (other.recommenderName != null)
				return false;
		} else if (!recommenderName.equals(other.recommenderName))
			return false;
		if (remarks == null) {
			if (other.remarks != null)
				return false;
		} else if (!remarks.equals(other.remarks))
			return false;
		if (sheetNumber == null) {
			if (other.sheetNumber != null)
				return false;
		} else if (!sheetNumber.equals(other.sheetNumber))
			return false;
		return true;
	}

	
}
